package dt.inlee.system.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import dt.inlee.common.dao.impl.GenericHibernateDao;
import dt.inlee.system.dao.api.IDxTextMessageDao;
import dt.inlee.system.model.DxTextMessage;


@Repository("dxTextMessageDao")
public class DxTextMessageDao extends GenericHibernateDao<DxTextMessage, String> implements
		IDxTextMessageDao {


	@SuppressWarnings("unchecked")
    public List<Object[]> findBySql(String sql, Integer pageIndex,
			Integer pageSize) {
		Query query = this.getSession().createSQLQuery(sql);
		query.setFirstResult((pageIndex - 1) * pageSize);
		query.setMaxResults(pageSize);
		return query.list();
	}
	
	
	
}